#define _CRT_SECURE_NO_WARNINGS 1
#include"NodeList.h"
void NLinit(NL* head)
{
	head->def = head;
	head->fro = head;
}
NL* BuyNode()
{
	NL* tem = (NL*)malloc(sizeof(NL));
	if (!tem)
	{
		perror("malloc:");
		exit(-1);
	}
	return tem;
}
void NLtailadd(NL* head,mydt x)
{
	NL* cur = head;
	while (cur->def != head)
	{
		cur = cur->def;
	}
	NL* tem = BuyNode();
	cur->def = tem;
	tem->fro = cur;
	tem->def = head;
	head->fro = tem;
	tem->val = x;
}
void NLprint(NL* head)
{
	NL* cur = head->def;
	while (cur != head)
	{
		printf("%d <=> ", cur->val);
		cur = cur->def;
	}
	printf("\n");
}
